Xbasic

PDF_ENCRYPT Function

Syntax

Result_Flag as L = PDF_Encrypt(C source_File ,C result_File ,C owner_password ,C user_password ,L canPrint ,L canModifyDocument ,L canCopy ,L canAddNotes [,L use128BitKey ])

Arguments

Result_Flag

.T. = Indicates the operation was successful. .F. = Indicates the operation failed.

source_File

The name of the PDF file to encrypt.

result_File

The name of the new encrypted PDF file.

owner_password

The password of the author of the PDF file.

user_password

Optional. Default = "" (no password). The password of the reader of the PDF file.

canPrint

Logical. .T. = The user is allowed to print the from the PDF document. .F. = The user is not allowed to print from the PDF document.

canModifyDocument

Logical. Optional. Default = .T. .T. = The user is allowed to edit the PDF document. .F. = The user is not allowed to edit the PDF document.

canCopy

Logical. Optional. Default = .T. .T. = The user is allowed to copy content from the PDF document. .F. = The user is not allowed to copy content from the PDF document.

canAddNotes

Logical. Optional. Default = .T. .T. = The user is allowed to add notes to the PDF document. .F. = The user is not allowed to add notes to the PDF document.

use128BitKey

Logical. Optional. Default = .T. .T. = Use 128 bit encryption. .F. = Do not use 128 bit encryption.

Description

The PDF_ENCRYPT() function adds password security to a PDF file.. User_password is optional.

Example

? pdf_encrypt("c:\inv.pdf", "c:\combined.pdf", "alpha", "alpha", .T., .F., .F., .F., .T.)
= .T.

See Also